import getState from "@/api/state";
import HorizontalBarChart from "@/template/HorizontalBarChart/HorizontalBarChart";
import React from "react";
import { useEffect } from "react";
import { useState } from "react";

const Home9 = ({ condition }) => {
    const [message, setMessage] = useState("暂无数据");

    const [loading, setLoading] = useState(false)
    const [state, setState] = useState({
        data: [

        ]
    })


    useEffect(() => {
        getState({
            apiUrl: "/cifgp-core-api/synt/monthAndYear",
            state,
            condition: { ...condition, cType: "syntsubsidiary" },
            setState,
            setLoading,
            setMessage
        })
    }, [condition])


    return (
        <>
            <HorizontalBarChart
                message={message}
                loading={loading}
                style={{ width: "20%" }}
                title="子机构客户量统计"
                hideBtn
                data={[state
                ]}
                unit="客户量"
                fieldNames={{
                    name: "",
                    value: "个"
                }}
            />
        </>
    )
}
export default Home9;